package cn.czh0123.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

@Data
@EqualsAndHashCode(callSuper = true)
@TableName("comment")
public class Comment extends BasicDomain {

    private Long userId;
    @NotNull(message = "评论壁纸不能为空！")
    private Long wallpaperId;
    @NotBlank(message = "评论内容不能为空！")
    private String content;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date commentTime;

    @TableField(exist = false)
    private String userName;
    @TableField(exist = false)
    private String userAvatar;

}